//
//  BMKCustomeAnnoationView.m
//  i5db
//
//  Created by iMuse on 15-5-28.
//  Copyright (c) 2015年 mySelf. All rights reserved.
//

#import "BMKCustomeAnnoationView.h"

@implementation BMKCustomeAnnoationView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initView];
    }
    return self;
}

- (id)initWithAnnotation:(id<BMKAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithAnnotation:annotation reuseIdentifier:reuseIdentifier];
    
    if (self)
    {
        self.backgroundColor = [UIColor clearColor];
        self.canShowCallout = YES;
        
        [self initView];
    }
    return self;
}
-(void)layoutSubviews
{
    [self initView];
}
-(void)initView
{
    if (self.regionDetailView) {
        [self.regionDetailView removeFromSuperview];
    }
    
    self.regionDetailView = [[UIView alloc] init];
    self.regionDetailView.backgroundColor = [UIColor clearColor];
    self.bgImageView = [[UIImageView alloc] init];
    
    self.bgImageView.image = [[UIImage imageNamed:@"wl_map_icon_5.png"] stretchableImageWithLeftCapWidth:28 topCapHeight:16];
    [self.regionDetailView addSubview:self.bgImageView];
}
@end
